function submitSearch() {
    //$("#searchTable").submit();
    $('#customer_table').datagrid('load',{
        nameSelect: $('#nameSelect').val(),
        phoneSelect:$('#phoneSelect').val(),
        emailSelect:$("#emailSelect").val()
    });
}

function resetSearch() {
    $("#nameSelect").textbox("setValue","");
    $("#phoneSelect").textbox("setValue","");
    $("#emailSelect").textbox("setValue","");
}

//function formatAction(value,row,index) {
//    var a = '<input type="button" value="详情" class="input" onclick="customer_see('+row.cust_id+');">';
//    var b = '&nbsp;&nbsp;&nbsp;<input type="button" value="编辑" class="input" onclick="customer_update('+row.cust_id+');">';
//    return a+b;
//}

function customer_see() {
    var obj=$("#customer_table").datagrid('getSelected');
    //console.log($('#customer_table').datagrid('getPager').data("pagination").options.pageNumber);
    if(obj==null){
        alert("请选择客户！");
        return;
    }
    var cust_id=obj.cust_id;
    window.parent.addTab('客户详情','../../customer/customer/customer_see?cust_id='+cust_id);
}

function customer_update() {
    var obj=$("#customer_table").datagrid('getSelected');
    //console.log($('#customer_table').datagrid('getPager').data("pagination").options.pageNumber);
    if(obj==null){
        alert("请选择客户！");
        return;
    }
    var cust_id=obj.cust_id;
    //var array=$("#searchTable").serialize();
    //var pageNumber=$('#customer_table').datagrid("options").pageNumber;
    window.parent.addTab('客户编辑','../../customer/customer/customer_basic?cust_id='+cust_id);
}

function customer_add() {
    window.parent.addTab("客户新增","../../customer/customer/customer_add");
}